home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / AppsToGo / AppsToGo.src / DTS.Lib / CDEFs / StatTextCDEF.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-18  |  1.6 KB  |  109 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** Program:         StatTextCDEF.c
  5. ** Written by:      Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11.  
  12.  
  13. /*****************************************************************************/
  14.  
  15.  
  16.  
  17. #ifndef __CONTROLS__
  18. #include <Controls.h>
  19. #endif
  20.  
  21. #ifndef __FONTS__
  22. #include <Fonts.h>
  23. #endif
  24.  
  25. #ifndef __MEMORY__
  26. #include <Memory.h>
  27. #endif
  28.  
  29. #ifndef __TEXTEDIT__
  30. #include <TextEdit.h>
  31. #endif
  32.  
  33.  
  34.  
  35. pascal long        CStatTextCtl(short varCode, ControlHandle ctl, short msg, long parm);
  36.  
  37.  
  38.  
  39. /*****************************************************************************/
  40.  
  41.  
  42.  
  43. #pragma segment StatTextCDEF
  44. pascal long    CStatTextCtl(short varCode, ControlHandle ctl, short msg, long parm)
  45. {
  46.     Rect            rct;
  47.     WindowPtr        curPort;
  48.     short            txFont, txSize;
  49.     Style            txFace;
  50.  
  51.     rct = (*ctl)->contrlRect;
  52.  
  53.     switch (msg) {
  54.  
  55.         case drawCntl:
  56.             GetPort(&curPort);
  57.             txFont = curPort->txFont;
  58.             txFace = curPort->txFace;
  59.             txSize = curPort->txSize;
  60.             if (!(varCode & useWFont)) {
  61.                 TextFont(systemFont);
  62.                 TextFace(normal);
  63.                 TextSize(0);
  64.             }
  65.  
  66.             HLock((Handle)ctl);
  67.             TextBox((*ctl)->contrlTitle + 1, (*ctl)->contrlTitle[0], &rct, teFlushDefault);
  68.             HUnlock((Handle)ctl);
  69.  
  70.             TextFont(txFont);
  71.             TextFace(txFace);
  72.             TextSize(txSize);
  73.             break;
  74.  
  75.         case testCntl:
  76.             break;
  77.  
  78.         case calcCRgns:
  79.         case calcCntlRgn:
  80.             if (msg == calcCRgns)
  81.                 parm &= 0x00FFFFFF;
  82.             RectRgn((RgnHandle)parm, &rct);
  83.             break;
  84.  
  85.         case initCntl:
  86.             break;
  87.  
  88.         case dispCntl:
  89.             break;
  90.  
  91.         case posCntl:
  92.             break;
  93.  
  94.         case thumbCntl:
  95.             break;
  96.  
  97.         case dragCntl:
  98.             break;
  99.  
  100.         case autoTrack:
  101.             break;
  102.     }
  103.  
  104.     return(0);
  105. }
  106.  
  107.  
  108.  
  109.